package com.itlaoqi.cf.service;

import com.itlaoqi.cf.dto.Order;

import java.util.ArrayList;
import java.util.List;

public class OrderService {

    private List<Order> orders = new ArrayList<>();

    public OrderService() {
        orders.add(new Order("ORD1001", "CUST001", "Laptop", 1, 1200.00));
        orders.add(new Order("ORD1002", "CUST002", "Smartphone", 2, 1600.00));
        orders.add(new Order("ORD1003", "CUST003", "Headphones", 1, 250.00));
    }


    public List<Order> search() {
        System.out.println("execute OrderService.search()");
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return orders;
    }
}
